#include "stdafx.h"
#include "TestSpco.h"
#include "Spco.h"

CPPUNIT_TEST_SUITE_REGISTRATION( TestSpco );
using namespace PDMS::PDMSFrame;

TestSpco::TestSpco()
{
}


TestSpco::~TestSpco()
{
}

void TestSpco::TestClone()
{
	UeDbObject* pSpco = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Spco) );
	CPPUNIT_ASSERT( pSpco );
	CPPUNIT_ASSERT( pSpco->Clone() );

}

void TestSpco::TestIsLegalParent()
{
	UeDbObject* pSpco = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Spco) );
	UeDbObject* pObj = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Sele) );
	UeDbObject* pSpec = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Spec) );
	CPPUNIT_ASSERT( pSpco );
	CPPUNIT_ASSERT( pObj );
	CPPUNIT_ASSERT( pSpec );
	CPPUNIT_ASSERT( pSpco->IsLegalParent(pSpec) );
	CPPUNIT_ASSERT( !pSpco->IsLegalParent( pSpco ) );
	CPPUNIT_ASSERT( pSpco->IsLegalParent( pObj ) );
}	